#Leap Year Finder

def leapfinder():
    print "Leap Year Finder" #Welcome screen (sorta)

    #Declare a year to None so the while loop will work...
    #Prompt the user for a year.
    year = None
    while not year:
        try:
            year = int(raw_input("Enter a year: "))
        except ValueError:
            print "Not a valid year!"

    #If the year is divisible by 4 and not 100, it's a leap year.
    #If the year is divisible by 4, not 100, but is divisible by 400, it's a
    # leap year. For all other outcomes, not a leap year...
    if year % 4 == 0:
        if year % 100 != 0:
            print year, "is a leap year."
        else:
            if year % 400 == 0:
                print year, "is a leap year."
            else:
                print year, "is not a leap year."
    else:
        print year, "is not a leap year."

leapfinder() #Call leapfinder() to start the program!
